<div class="animated fadeIn">    
    <!-- Nav tabs -->
    <ul class="nav nav-tabs" role="tablist">
        <li class="active"><a href="#informasi_umum" role="tab" data-toggle="tab">Informasi Umum</a></li>
        <li><a href="#penduduk" role="tab" data-toggle="tab">Penduduk</a></li>        
        <li><a href="#tamu" role="tab" data-toggle="tab">Tamu</a></li>        
        <li><a href="#kipem" role="tab" data-toggle="tab">Kipem</a></li>        
        <li><a href="#stld" role="tab" data-toggle="tab">STLD</a></li>        
    </ul>

    <!-- Tab panes -->
    <div class="tab-content">
        <div class="tab-pane active" id="informasi_umum">

            <table class="table table-user-information animated fadeIn">
                <tbody>
                
                    <tr>
                        <td>Nama</td>
                        <td>{{ $lokasi->nama }} (Pemilik : <a href="{{ URL::route('penduduks.show', $lokasi->penduduk_id) }}" target="_blank">{{ $pemilik->nama }}</a>)</td>
                    </tr>            
                    <tr>
                        <td>Tipe</td>
                        <td>{{ $lokasi->tipe->nama }}</td>
                    </tr>            
                    <tr>
                        <td>Alamat</td>
                        <td>{{ $lokasi->alamat }}</td>
                    </tr>            
                    <tr>
                        <td>Keterangan</td>
                        <td>{{ $lokasi->keterangan }}</td>
                    </tr>       
                    <tr>
                        <td>Banyak Penduduk</td>
                        <td><span class="label label-info">{{ count($lokasi->penduduks) }} Orang</span></td>
                    </tr>
                    <tr>
                        <td colspan="2">                            
                            <div id="mapModal" class="map_canvas"></div>
                            <input type="hidden" id="latFld" value="{{ $lokasi->lat_lng[0] }}">
                            <input type="hidden" id="lngFld" value="{{ $lokasi->lat_lng[1] }}">
                        </td>
                    </tr>    
                                 
                </tbody>
            </table>  

        </div>
        <div class="tab-pane" id="penduduk">            
            <br>
            @if(count( $lokasi->penduduks ) > 0)                
                <table class="table table-hover animated fadeIn">
                    <thead>                                
                        <th width="20%">NIK</th>
                        <th width="15%">No KK</th>
                        <th>Nama</th>                    
                        <th>JK</th>                    
                        <th>Umur</th>                    
                    </thead>
                    <tbody>                    
                        <?php $no = 0; ?>
                        @foreach($penduduks_by_no_kk as $penduduks)                        
                        @foreach($penduduks as $penduduk)
                            <?php $no++; ?>
                            <tr>                                
                                <td>{{ $penduduk->nik }}</td>
                                <td><a href="#" class="btn-no-kk">{{ $penduduk->no_kk }}</a></td>                            
                                <td>{{ $penduduk->nama }}</td>
                                <td>{{ $penduduk->jenis_kelamin }}</td>
                                <td>{{ umur($penduduk->tanggal_lahir) }}</td>
                            </tr>                        
                        @endforeach                            
                        @endforeach
                    </tbody>
                </table>                
            @else
                <div class="callout callout-warning animated fadeIn">
                    <p>Belum ada penduduk di lokasi ini.</p>
                </div>
            @endif
        </div>    
        <div class="tab-pane" id="tamu">   
            <br>            
            @if(count($tamus) > 0)
                 <table class="table table-hover animated fadeIn">
                    <thead>                                
                        <th width="20%">No KTP</th>                        
                        <th>Nama</th>                    
                        <th>JK</th>                    
                        <th>Umur</th>
                        <th>Berakhir Kipem</th>                    
                    </thead>
                    <tbody>            
                        <?php $no = 0; ?>
                        @foreach($tamus as $tamu)
                            <?php $no++; ?>
                            <tr>
                                <td>{{ $tamu->no_ktp }}</td>
                                <td>{{ $tamu->nama }}</td>
                                <td>{{ $tamu->jenis_kelamin }}</td>
                                <td>{{ umur($tamu->tanggal_lahir) }}</td>
                                <td>{{ $tamu->tanggal_akhir }}</td>
                            </tr>
                        @endforeach
                    </tbody>
                </table>
            @else
                <div class="callout callout-warning animated fadeIn">
                    <p>Belum ada tamu di lokasi ini.</p>
                </div>
            @endif
        </div>
        <div class="tab-pane" id="kipem">   
            <br>            
            @if(count($kipems) > 0)
                 <table class="table table-hover animated fadeIn">
                    <thead>                                
                        <th width="20%">No Kipem</th>                        
                        <th width="20%">No KTP</th>                        
                        <th>Nama</th>                    
                        <th>JK</th>                    
                        <th>Umur</th>
                        <th>Berakhir Kipem</th>                    
                    </thead>
                    <tbody>            
                        <?php $no = 0; ?>
                        @foreach($kipems as $kipem)
                            <?php $no++; ?>
                            <tr>
                                <td>{{ $kipem->nomor }}</td>
                                <td>{{ $kipem->no_ktp }}</td>
                                <td>{{ $kipem->nama }}</td>
                                <td>{{ $kipem->jenis_kelamin }}</td>
                                <td>{{ umur($kipem->tanggal_lahir) }}</td>
                                <td>{{ $kipem->tanggal_akhir }}</td>
                            </tr>
                        @endforeach
                    </tbody>
                </table>
            @else
                <div class="callout callout-warning animated fadeIn">
                    <p>Belum ada Kipem di lokasi ini.</p>
                </div>
            @endif
        </div>    
        <div class="tab-pane" id="stld">   
            <br>
            @if(count($stlds) > 0)
                 <table class="table table-hover animated fadeIn">
                    <thead>                                                        
                        <th width="20%">No KTP</th>                        
                        <th>Nama</th>                    
                        <th>JK</th>                    
                        <th>Umur</th>
                        <th>Pendidikan</th>                    
                    </thead>
                    <tbody>            
                        <?php $no = 0; ?>
                        @foreach($stlds as $stld)
                            <?php $no++; ?>
                            <tr>                                
                                <td>{{ $stld->no_ktp }}</td>
                                <td>{{ $stld->nama }}</td>
                                <td>{{ $stld->jenis_kelamin }}</td>
                                <td>{{ umur($stld->tanggal_lahir) }}</td>
                                <td>{{ $stld->pendidikan->nama }}</td>
                            </tr>
                        @endforeach
                    </tbody>
                </table>
            @else
                <div class="callout callout-warning animated fadeIn">
                    <p>Belum ada STLD di lokasi ini.</p>
                </div>
            @endif
        </div>    
    </div>    

</div>